<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2017/6/16
 * Time: 9:49
 * Project name: PHPTEST
 * File name: 1.php
 * @copyright Copyright (c) 2016 ZRX Software LLC
 * @license https://github.com/zhangrxiang
 * @since 1.0.0
 */

//filter_input() 函数从脚本外部获取输入，并进行过滤。
//INPUT_GET
//INPUT_POST
//INPUT_COOKIE
//INPUT_ENV
//INPUT_SERVER
//INPUT_SESSION (Not yet implemented)
//INPUT_REQUEST (Not yet implemented)

if (!filter_input(INPUT_GET, 'email', FILTER_VALIDATE_EMAIL))
{
    echo "E-Mail is not valid";
}
else
{
    echo "E-Mail is valid";
}